package utility;

import java.util.ArrayList;
import weka.core.Instance;
import weka.core.Instances;

public class InstancesConverter {
  
  public static ArrayList<ArrayList<String>> convert (Instances data) {
    ArrayList<ArrayList<String>> list = new ArrayList<ArrayList<String>>();
    for (int instance = 0; instance < data.numInstances(); instance++) {
      ArrayList<String> temp = new ArrayList<String>();
      for (int col = 0; col < data.instance(instance).numValues(); col++) {
        temp.add(data.instance(instance).stringValue(col));
      }
      list.add(temp);
    }
    return list;
  }
  public static ArrayList<String> convert2 (Instance data) {
    ArrayList<String> list = new ArrayList<String>();
      for (int col = 0; col < data.numAttributes(); col++) {
        list.add(data.toString(col));
      }
    return list;
  }
  
  public static void main (String args[]) {
      
  }
  
}
